PopupParentElement

interface PopupParentElement : ParentElement, LastSelectable

A parent element that supports displaying "Popups" made via PopupWidget.

If a PopupParentElement has one or more active popups, it will prioritize those over passing inputs to any "normal" children. If you have any input handling you need to implement, make sure to handle it and return before calling super, so avoid any active popups potentially doubling up on captured input handling.

Author

fzzyhmstrs

Since

0.2.0

See also

Inheritors

Properties

Link copied to clipboard

Boolean prevents mouseReleased from triggering on the Popup or Widget underneath the active popup if it's closed on mouseClicked

Link copied to clipboard
abstract var lastSelected: Element?

getter and setter for the cached element.

Link copied to clipboard

A stack for holding popupwidgets while allowing for easy list iteration as needed. For rendering this stack should be traversed in reverse order, which LinkedList makes easy with descendingIterator

Functions

Link copied to clipboard
Link copied to clipboard
abstract fun blurElements()

Called by this parent element when it pushes a PopupWidget to its stack. This method should "blur" the focus of the underlying children in this parent element; using blur() from Screen, for example.

Link copied to clipboard
open override fun charTyped(chr: Char, modifiers: Int): Boolean
Link copied to clipboard
abstract fun children(): MutableList<out Element>
Link copied to clipboard
open fun focusOn(@Nullable element: Element?)
Link copied to clipboard
@Nullable
abstract fun getFocused(): Element?
Link copied to clipboard
@Nullable
open override fun getFocusedPath(): GuiNavigationPath?
Link copied to clipboard
open fun getNavigationFocus(): ScreenRect
Link copied to clipboard
Link copied to clipboard
@Nullable
open override fun getNavigationPath(navigation: GuiNavigation): GuiNavigationPath?
Link copied to clipboard
open override fun hoveredElement(mouseX: Double, mouseY: Double): Optional<Element>
Link copied to clipboard
abstract fun initPopup(widget: PopupWidget)

called when a Popup is pushed to this element, after blurring.

Link copied to clipboard
abstract fun isDragging(): Boolean
Link copied to clipboard
open override fun isFocused(): Boolean
Link copied to clipboard
open fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean
Link copied to clipboard
open fun mouseMoved(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseScrolled(mouseX: Double, mouseY: Double, verticalAmount: Double): Boolean
Link copied to clipboard
open override fun popLast()

Indicates that the overlay has been removed and the parent should return focus to the cached element, if any, in lastSelected

Link copied to clipboard
open override fun pushLast()

Indicates to the parent element to cache it's current focused element. The current focused element should be stored in lastSelected

Link copied to clipboard
open fun resetHover(mouseX: Double, mouseY: Double)

When called the parent element should reselect a hovered element based on the supplied mouse positions, if it tracks such things

Link copied to clipboard
abstract fun setDragging(dragging: Boolean)
Link copied to clipboard
open override fun setFocused(focused: Boolean)
abstract fun setFocused(@Nullable focused: Element?)
Link copied to clipboard
open fun setPopup(widget: PopupWidget?, mouseX: Double? = null, mouseY: Double? = null)

Applies a popup widget to this parent. If null is passed, removes the top (newest) popup instead